package com.app.utils.temp;

import android.os.Build;

import androidx.annotation.RequiresApi;

import java.util.Objects;

/**
 * Created by lzy on 2020/9/8.
 */
public class Person {
    private long idCard;
    private String name;
    private int age;
    private boolean sex;

    public long getIdCard() {
        return idCard;
    }

    public void setIdCard(long idCard) {
        this.idCard = idCard;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return idCard == person.idCard &&
                Objects.equals(name, person.name);
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public int hashCode() {
        return Objects.hash(idCard, name);
    }

    @Override
    public String toString() {
        return "Person{" +
                "idCard=" + idCard +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
